// 显示提示信息
function divMsg(dom, result, classType, stayMilliSecond){
	$(dom).text(result);
	$(dom).addClass(classType);
	$(dom).show();

	if (null == stayMilliSecond || undefined == stayMilliSecond)
		stayMilliSecond = 6000;
	$(dom).fadeOut(stayMilliSecond);
}


function onLogin() {
	var callback = function(response) {
		if (0 == response.code)
			window.location.href = 'messageList.html';
		else
			divMsg('#dataMsg', response.message, 'alert-success');
	};

	$.post("../user/login", {"userName":document.getElementById("userName").value, "userPassword":document.getElementById("userPassword").value}, callback);
}

